class CreateLogs < ActiveRecord::Migration
  def self.up
    create_table :logs do |t|
      t.integer         :device_id                                              #设备ID
      t.integer         :worker_id                                              #员工ID
      t.integer         :is_locked     ,:limit => 1 ,:default => 0              #锁定 1为True 0为False
      t.integer         :lock_version  ,:default => 0                           #乐观锁
      t.timestamps
    end
  end

  def self.down
    drop_table :logs
  end
end
